/**
 * 实例方法和静态方法
 * 使用static声明静态方法
 */


class Person {
    static create(name){
        return new Person(name)
    }
    constructor(name) {
        this.name = name
    }
    say() {
        console.log(`hi,my name is ${this.name}`)
    }
}
// let p = new Person('tom')
// p.say()

let p = Person.create('tom')
console.log(p)